using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._AnalysisTools._Statistics
{
    /// <summary>
    /// <para>Summarize Within</para>
    /// <para>Overlays a polygon layer with another layer to summarize the number of points, length of the lines, or area of the polygons within each polygon, and calculate attribute field statistics about those features within the polygons.</para>
    /// <para>将一个面图层与另一个图层叠加，以汇总每个面内面的点数、线的长度或面的面积，并计算面内这些要素的属性字段统计数据。</para>
    /// </summary>    
    [DisplayName("Summarize Within")]
    public class SummarizeWithin : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public SummarizeWithin()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_polygons">
        /// <para>Input Polygons</para>
        /// <para>The polygons used to summarize the features, or portions of features, in the input summary layer.</para>
        /// <para>用于汇总输入汇总图层中的要素或要素部分的面。</para>
        /// </param>
        /// <param name="_in_sum_features">
        /// <para>Input Summary Features</para>
        /// <para>The point, line, or polygon features that will be summarized for each polygon in the input polygons.</para>
        /// <para>将为输入面中的每个面汇总的点、线或面要素。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para>The output polygon feature class containing the same geometries and attributes as the input polygons with additional new attributes about the number points, length of lines, and area of polygons inside each input polygon and statistics about those features.</para>
        /// <para>输出面要素类包含与输入面相同的几何和属性，以及有关每个输入面内面的数点、线长度和面面积的附加新属性以及有关这些要素的统计数据。</para>
        /// </param>
        public SummarizeWithin(object _in_polygons, object _in_sum_features, object _out_feature_class)
        {
            this._in_polygons = _in_polygons;
            this._in_sum_features = _in_sum_features;
            this._out_feature_class = _out_feature_class;
        }
        public override string ToolboxName => "Analysis Tools";

        public override string ToolName => "Summarize Within";

        public override string CallName => "analysis.SummarizeWithin";

        public override List<string> AcceptEnvironments => ["XYDomain", "XYResolution", "XYTolerance", "ZDomain", "ZResolution", "ZTolerance", "extent", "geographicTransformations", "outputCoordinateSystem", "outputZFlag", "outputZValue", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_in_polygons, _in_sum_features, _out_feature_class, _keep_all_polygons.GetGPValue(), _sum_fields, _sum_shape.GetGPValue(), _shape_unit.GetGPValue(), _group_field, _add_min_maj.GetGPValue(), _add_group_percent.GetGPValue(), _out_group_table];

        /// <summary>
        /// <para>Input Polygons</para>
        /// <para>The polygons used to summarize the features, or portions of features, in the input summary layer.</para>
        /// <para>用于汇总输入汇总图层中的要素或要素部分的面。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Polygons")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_polygons { get; set; }


        /// <summary>
        /// <para>Input Summary Features</para>
        /// <para>The point, line, or polygon features that will be summarized for each polygon in the input polygons.</para>
        /// <para>将为输入面中的每个面汇总的点、线或面要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Summary Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_sum_features { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>The output polygon feature class containing the same geometries and attributes as the input polygons with additional new attributes about the number points, length of lines, and area of polygons inside each input polygon and statistics about those features.</para>
        /// <para>输出面要素类包含与输入面相同的几何和属性，以及有关每个输入面内面的数点、线长度和面面积的附加新属性以及有关这些要素的统计数据。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Keep all input polygons</para>
        /// <para><xdoc>
        ///   <para>Determines if all input polygons or only those intersecting or containing at least one input summary feature will be copied to the output feature class.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—All input polygons will be copied to the output feature class. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Only input polygons that intersect or contain at least one input summary feature will be copied to the output feature class.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>确定是将所有输入面复制到输出要素类，还是仅复制与至少一个输入汇总要素相交或包含输入汇总要素的输入面。</para>
        ///   <bulletList>
        ///     <bullet_item>选中—所有输入面都将复制到输出要素类。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 仅与至少一个输入汇总要素相交或包含至少一个输入汇总要素的输入面才会被复制到输出要素类。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Keep all input polygons")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _keep_all_polygons_value _keep_all_polygons { get; set; } = _keep_all_polygons_value._true;

        public enum _keep_all_polygons_value
        {
            /// <summary>
            /// <para>KEEP_ALL</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("KEEP_ALL")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>ONLY_INTERSECTING</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ONLY_INTERSECTING")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Summary Fields</para>
        /// <para><xdoc>
        ///   <para>A list of attribute field names from the input summary features, and statistical summary types that you wish to calculate for those attribute fields for all points within each polygon.</para>
        ///   <para>Summary fields must be numeric. Text and other attribute field types are not supported.</para>
        ///   <para>Statistic types include:
        ///   <bulletList>
        ///     <bullet_item>Sum—Adds the total value of all the points in each polygon.  </bullet_item><para/>
        ///     <bullet_item>Mean—Calculates the average of all the points in each polygon.  </bullet_item><para/>
        ///     <bullet_item>Min—Finds the smallest value of all the points in each polygon.  </bullet_item><para/>
        ///     <bullet_item>Max—Finds the largest value of all the points in each polygon.  </bullet_item><para/>
        ///     <bullet_item>Stddev—Finds the standard deviation of all the points in each polygon.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入汇总要素中的属性字段名称列表，以及要为每个面内所有点的这些属性字段计算的统计汇总类型。</para>
        ///   <para>摘要字段必须为数字。不支持文本和其他属性字段类型。</para>
        /// <para>统计信息类型包括：
        ///   <bulletList>
        ///     <bullet_item>总和 （Sum） - 将每个面中所有点的总值相加。</bullet_item><para/>
        ///     <bullet_item>平均值 （Mean） - 计算每个面中所有点的平均值。</bullet_item><para/>
        ///     <bullet_item>最小值 （Min） - 查找每个面中所有点的最小值。</bullet_item><para/>
        ///     <bullet_item>最大值 （Max） - 查找每个面中所有点的最大值。</bullet_item><para/>
        ///     <bullet_item>Stddev - 查找每个面中所有点的标准差。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Summary Fields")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _sum_fields { get; set; } = null;


        /// <summary>
        /// <para>Add shape summary  attributes</para>
        /// <para><xdoc>
        ///   <para>Determines if the output feature class will contain attributes for the number of points, length of lines, and area of polygon features summarized in each input polygon.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Add shape summary attributes to the output feature class. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Do not add shape summary attributes to the output feature class.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>确定输出要素类是否包含每个输入面中汇总的点数、线长度和面要素面积的属性。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 将形状汇总属性添加到输出要素类。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 不向输出要素类添加形状汇总属性。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Add shape summary  attributes")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _sum_shape_value _sum_shape { get; set; } = _sum_shape_value._true;

        public enum _sum_shape_value
        {
            /// <summary>
            /// <para>ADD_SHAPE_SUM</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ADD_SHAPE_SUM")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_SHAPE_SUM</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_SHAPE_SUM")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Shape Unit</para>
        /// <para><xdoc>
        ///   <para>The unit in which to calculate shape summary attributes. If the input summary features are points no shape unit is necessary, since only the count of points within each input polygon is added.</para>
        ///   <para></para>
        ///   <para>If the input summary features are lines, specify a linear unit. If the input summary features are polygons, specify an areal unit.</para>
        ///   <bulletList>
        ///     <bullet_item>Meters—Meters</bullet_item><para/>
        ///     <bullet_item>Kilometers—Kilometers</bullet_item><para/>
        ///     <bullet_item>Feet—Feet</bullet_item><para/>
        ///     <bullet_item>Yards—Yards</bullet_item><para/>
        ///     <bullet_item>Miles—Miles</bullet_item><para/>
        ///     <bullet_item>Acres—Acres</bullet_item><para/>
        ///     <bullet_item>Hectares—Hectares</bullet_item><para/>
        ///     <bullet_item>Square meters—Square meters</bullet_item><para/>
        ///     <bullet_item>Square kilometers—Square kilometers</bullet_item><para/>
        ///     <bullet_item>Square feet—Square feet</bullet_item><para/>
        ///     <bullet_item>Square yards—Square yards</bullet_item><para/>
        ///     <bullet_item>Square miles—Square miles</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于计算形状汇总属性的单位。如果输入汇总要素为点，则不需要形状单位，因为仅添加每个输入面中的点数。</para>
        ///   <para></para>
        ///   <para>如果输入汇总要素为线，则指定线性单位。如果输入汇总要素为面，则指定区域单位。</para>
        ///   <bulletList>
        ///     <bullet_item>米 - 米</bullet_item><para/>
        ///     <bullet_item>公里 - 公里</bullet_item><para/>
        ///     <bullet_item>英尺 - 英尺</bullet_item><para/>
        ///     <bullet_item>码 - 码</bullet_item><para/>
        ///     <bullet_item>英里 - 英里</bullet_item><para/>
        ///     <bullet_item>英亩 - 英亩</bullet_item><para/>
        ///     <bullet_item>公顷 - 公顷</bullet_item><para/>
        ///     <bullet_item>平方米 - 平方米</bullet_item><para/>
        ///     <bullet_item>平方公里 - 平方公里</bullet_item><para/>
        ///     <bullet_item>平方英尺 - 平方英尺</bullet_item><para/>
        ///     <bullet_item>平方码 - 平方码</bullet_item><para/>
        ///     <bullet_item>平方英里 - 平方英里</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Shape Unit")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _shape_unit_value? _shape_unit { get; set; } = null;

        public enum _shape_unit_value
        {
            /// <summary>
            /// <para>Acres</para>
            /// <para>Acres—Acres</para>
            /// <para>英亩 - 英亩</para>
            /// </summary>
            [Description("Acres")]
            [GPEnumValue("ACRES")]
            _ACRES,

            /// <summary>
            /// <para>Hectares</para>
            /// <para>Hectares—Hectares</para>
            /// <para>公顷 - 公顷</para>
            /// </summary>
            [Description("Hectares")]
            [GPEnumValue("HECTARES")]
            _HECTARES,

            /// <summary>
            /// <para>Square meters</para>
            /// <para>Square meters—Square meters</para>
            /// <para>平方米 - 平方米</para>
            /// </summary>
            [Description("Square meters")]
            [GPEnumValue("SQUAREMETERS")]
            _SQUAREMETERS,

            /// <summary>
            /// <para>Square kilometers</para>
            /// <para>Square kilometers—Square kilometers</para>
            /// <para>平方公里 - 平方公里</para>
            /// </summary>
            [Description("Square kilometers")]
            [GPEnumValue("SQUAREKILOMETERS")]
            _SQUAREKILOMETERS,

            /// <summary>
            /// <para>Square feet</para>
            /// <para>Square feet—Square feet</para>
            /// <para>平方英尺 - 平方英尺</para>
            /// </summary>
            [Description("Square feet")]
            [GPEnumValue("SQUAREFEET")]
            _SQUAREFEET,

            /// <summary>
            /// <para>Square yards</para>
            /// <para>Square yards—Square yards</para>
            /// <para>平方码 - 平方码</para>
            /// </summary>
            [Description("Square yards")]
            [GPEnumValue("SQUAREYARDS")]
            _SQUAREYARDS,

            /// <summary>
            /// <para>Square miles</para>
            /// <para>Square miles—Square miles</para>
            /// <para>平方英里 - 平方英里</para>
            /// </summary>
            [Description("Square miles")]
            [GPEnumValue("SQUAREMILES")]
            _SQUAREMILES,

            /// <summary>
            /// <para>Meters</para>
            /// <para>Meters—Meters</para>
            /// <para>米 - 米</para>
            /// </summary>
            [Description("Meters")]
            [GPEnumValue("METERS")]
            _METERS,

            /// <summary>
            /// <para>Kilometers</para>
            /// <para>Kilometers—Kilometers</para>
            /// <para>公里 - 公里</para>
            /// </summary>
            [Description("Kilometers")]
            [GPEnumValue("KILOMETERS")]
            _KILOMETERS,

            /// <summary>
            /// <para>Feet</para>
            /// <para>Feet—Feet</para>
            /// <para>英尺 - 英尺</para>
            /// </summary>
            [Description("Feet")]
            [GPEnumValue("FEET")]
            _FEET,

            /// <summary>
            /// <para>Yards</para>
            /// <para>Yards—Yards</para>
            /// <para>码 - 码</para>
            /// </summary>
            [Description("Yards")]
            [GPEnumValue("YARDS")]
            _YARDS,

            /// <summary>
            /// <para>Miles</para>
            /// <para>Miles—Miles</para>
            /// <para>英里 - 英里</para>
            /// </summary>
            [Description("Miles")]
            [GPEnumValue("MILES")]
            _MILES,

        }

        /// <summary>
        /// <para>Group Field</para>
        /// <para><xdoc>
        ///   <para>Attribute field from the input summary features that is used for grouping. Features that have the same group field value will be combined and summarized with other features with the same group field value.</para>
        ///   <para>When you chose a group field, an additional output grouped table will be created and its location must be specified. This output grouped table is required when using a group field.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于分组的输入汇总要素中的属性字段。具有相同组字段值的要素将与具有相同组字段值的其他要素进行组合和汇总。</para>
        ///   <para>选择组字段时，将创建一个附加的输出分组表，并且必须指定其位置。使用组字段时，此输出分组表是必需的。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Group Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _group_field { get; set; } = null;


        /// <summary>
        /// <para>Add minority and majority attributes</para>
        /// <para><xdoc>
        ///   <para>This option is only enabled if you have selected a group field. It allows you to determine which group field value is the minority (least dominant) and the majority (most dominant) within each input polygon.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Do not add minority and majority fields to the output. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—Add minority and majority fields to the output.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>仅当您选择了组字段时，才会启用此选项。它允许您确定哪个组字段值是每个输入面中的少数（最不主要）和多数（最主要）。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 不向输出添加少数和多数字段。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中 - 将少数和多数字段添加到输出中。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Add minority and majority attributes")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _add_min_maj_value _add_min_maj { get; set; } = _add_min_maj_value._false;

        public enum _add_min_maj_value
        {
            /// <summary>
            /// <para>ADD_MIN_MAJ</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ADD_MIN_MAJ")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_MIN_MAJ</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_MIN_MAJ")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Add group percentages</para>
        /// <para><xdoc>
        ///   <para>This option is only enabled if you have selected a group field. It allows you to determine the percentage of each attribute value within each group.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Do not add a percentage attribute field to the output. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—Add a percentage attribute field to the output.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>仅当您选择了组字段时，才会启用此选项。它允许您确定每个组中每个属性值的百分比。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 不向输出添加百分比属性字段。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中 - 将百分比属性字段添加到输出中。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Add group percentages")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _add_group_percent_value _add_group_percent { get; set; } = _add_group_percent_value._false;

        public enum _add_group_percent_value
        {
            /// <summary>
            /// <para>ADD_PERCENT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ADD_PERCENT")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_PERCENT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_PERCENT")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Output Grouped Table</para>
        /// <para><xdoc>
        ///   <para>If a group field is specified, the output grouped table is required.</para>
        ///   <para>An output table that includes summary fields for each group of summary features for each input polygon. The table will have the following attribute fields:
        ///   <bulletList>
        ///     <bullet_item>Join_ID—an ID corresponding to an ID field added to the output feature class.  </bullet_item><para/>
        ///     <bullet_item>The group field.  </bullet_item><para/>
        ///     <bullet_item>A shape summary field.  </bullet_item><para/>
        ///     <bullet_item>One field for each of the summary fields.  </bullet_item><para/>
        ///     <bullet_item>Percentage field.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>如果指定了组字段，则输出分组表是必需的。</para>
        /// <para>一个输出表，其中包含每个输入面的每组汇总要素的汇总字段。该表将包含以下属性字段：
        ///   <bulletList>
        ///     <bullet_item>Join_ID - 与添加到输出要素类的 ID 字段相对应的 ID。</bullet_item><para/>
        ///     <bullet_item>组字段。</bullet_item><para/>
        ///     <bullet_item>形状汇总字段。</bullet_item><para/>
        ///     <bullet_item>每个汇总字段对应一个字段。</bullet_item><para/>
        ///     <bullet_item>百分比字段。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Grouped Table")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _out_group_table { get; set; } = null;


        public SummarizeWithin SetEnv(object XYDomain = null, object XYResolution = null, object XYTolerance = null, object ZDomain = null, object ZResolution = null, object ZTolerance = null, object extent = null, object geographicTransformations = null, object outputCoordinateSystem = null, object outputZFlag = null, object outputZValue = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(XYDomain: XYDomain, XYResolution: XYResolution, XYTolerance: XYTolerance, ZDomain: ZDomain, ZResolution: ZResolution, ZTolerance: ZTolerance, extent: extent, geographicTransformations: geographicTransformations, outputCoordinateSystem: outputCoordinateSystem, outputZFlag: outputZFlag, outputZValue: outputZValue, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}